package com.internetCafes.spms.web.extend.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.internetCafes.spms.common.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author LinYe
 * @since 2020-12-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("x_ent_certi_quali_renewal")
public class EntCertiQualiRenewal implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /**
     * 企业id,引用t_tenant_info表
     */
    private Long tenantId;

    /**
     * 证书id,引用t_ent_certi_quali表
     */
    private Long certificateId;

    /**
     * 延期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date renewalDate;

    /**
     * 新有效时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date newStartDate;

    /**
     * 新结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date newExpireDate;

    /**
     * 延期费用
     */
    private Double renewalFee;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建者,引用t_employee_info表
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 更新人,引用t_employee_info表
     */
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    @Override
    public String toString() {
        return "延期日期:" + DateUtils.format(renewalDate) + "，新有效期起止时间："+ DateUtils.format(newStartDate) + "-" + DateUtils.format(newExpireDate) +"，备注:"+ remark + "；";
    }

}
